<template>
  <!-- 我的申请 -->
  <view class="apply-order">
    <!-- 搜索 -->
    <applySearch class="apply-three" 
      @search="getApplyData"
    ></applySearch>
    <!-- 卡片list -->
    <applyCardList class="apply-three"
      :dataList="applyArrList"
    >
    </applyCardList>
  </view>
</template>

<script setup>
import { onMounted, ref } from 'vue'
import applySearch from "/components/apply-sku-order/search-item.vue"
import applyCardList from "/components/apply-sku-order/card-list.vue"

/* 数据列 */ 
const applyArrList = ref([])
/* 获取领料单数据 */ 
const getApplyData = async (item)=> {
  console.log('iii---',item);
  const { data: res } = await uni.$http.get('/getMaterialApply',{storageCode: item !== undefined ? item.storageCode : ''})
  
  if(res.success){
    applyArrList.value = res.data
  } else {
    uni.showToast({ duration: 3000, icon:'none', title:res.msg })
  }
}
getApplyData()
// onMounted(()=>{
//   getApplyData()
// })


</script>

<style lang="scss">
.apply-order {
  width: 100%;
  height: 100%;

}
.apply-one {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding-left: 10px;
  padding-right: 5px;
  .one-left {
    width: 50%;
  }
  .one-right {
    width: 75%;
  }
}
.apply-two{
  width: 100%;
}
.apply-three {
  width: 100%;
  .right-img{
    width: 40px;
    height: 30px;
  }
}
</style>
